import storageUtil from '@/utils/StorageUtil'

// local storage Key常量
export const PageVersionKey = 'ps_MhProjectInfo-page-version-key'
export const ConditionShowListCkedKey = 'ps_MhProjectInfo-condition-column-show-cked-list-key'
export const ColumnShowListCkedKey = 'ps_MhProjectInfo-list-column-show-cked-list-key'
export const isDropMenuKey = 'ps_MhProjectInfo-list-column-show-isdropmenu-key'
export const ColumnShowListWidthKey = 'ps_MhProjectInfo-list-column-width-key'
export const IsExpandedRowCkedKey = 'ps_MhProjectInfo-list-isexpanded-row-key'


// 查询条件 type: input/date/date-range/num-range/select/tree/
export const conditionOptions = [
  /*{ property: 'id', label: 'ID', width: 200, show: true, type: 'input', dataResource: 0, enumName:'Id', remoteUrl: '' },*/
  { property: 'projectName', label: '项目名称', width: 200, show: true, type: 'input', dataResource: 0, enumName:'ProjectName', remoteUrl: '' },
  { property: 'status', label: '项目状态', width: 200, show: true, type: 'select', dataResource: 1, enumName:'Status', remoteUrl: '/citymh/enum/getData4AddBy' },
  /*{ property: 'projectAddr', label: '项目地址', width: 200, show: true, type: 'input', dataResource: 0, enumName:'ProjectAddr', remoteUrl: '' },
  { property: 'projectMainUnitLinkman', label: '项目负责人', width: 200, show: true, type: 'input', dataResource: 0, enumName:'ProjectMainUnitLinkman', remoteUrl: '' },
  /!* { property: 'unitBidderId', label: '定点供应商id', width: 200, show: true, type: 'input', dataResource: 0, enumName:'UnitBidderId', remoteUrl: '' },
*!/

  { property: 'projectBasis', label: '项目依据', width: 200, show: true, type: 'input', dataResource: 0, enumName:'ProjectBasis', remoteUrl: '' },
  { property: 'telephone', label: '联系电话', width: 200, show: true, type: 'input', dataResource: 0, enumName:'Telephone', remoteUrl: '' },
  { property: 'fundSourceCityFinacial', label: '市财力', width: 200, show: true, type: 'input', dataResource: 0, enumName:'FundSourceCityFinacial', remoteUrl: '' },/!*
  { property: 'fundSourceDistrictFinancing', label: '区融资', width: 200, show: true, type: 'input', dataResource: 0, enumName:'FundSourceDistrictFinancing', remoteUrl: '' },*!/
  { property: 'fundSourceDistrictFinance', label: '区财政', width: 200, show: true, type: 'input', dataResource: 0, enumName:'fundSourceDistrictFinance', remoteUrl: '' },
  { property: 'fundSourceOthers', label: '其他', width: 200, show: true, type: 'input', dataResource: 0, enumName:'FundSourceOthers', remoteUrl: '' },
  /!*{ property: 'categoryProject', label: '项目类型', width: 200, show: true, type: 'select', dataResource: 1, enumName:'CategoryProject', remoteUrl: '/citymh/enum/getData4AddBy' },
*!/  { property: 'totalInvestment', label: '建安投资', width: 200, show: true, type: 'input', dataResource: 0, enumName:'TotalInvestment', remoteUrl: '' },
  { property: 'startTimePlan', label: '项目预计开工时间', width: 200, show: true, type: 'date-range', dataResource: 0, enumName:'StartTimePlan', remoteUrl: '' },
  { property: 'endTimePlan', label: '项目预计完工时间', width: 200, show: true, type: 'date-range', dataResource: 0, enumName:'EndTimePlan', remoteUrl: '' },
  { property: 'startTimeActual', label: '项目实际开工时间', width: 200, show: true, type: 'date-range', dataResource: 0, enumName:'StartTimeActual', remoteUrl: '' },
  { property: 'endTimeActual', label: '项目实际完工时间', width: 200, show: true, type: 'date-range', dataResource: 0, enumName:'EndTimeActual', remoteUrl: '' },
  { property: 'investmentSupervision', label: '投资监理', width: 200, show: true, type: 'select', dataResource: 1, enumName:'Checked', remoteUrl: '/citymh/enum/getData4AddBy' },
  { property: 'investmentSupervisionTime', label: '投资监理时间', width: 200, show: true, type: 'date-range', dataResource: 0, enumName:'InvestmentSupervisionTime', remoteUrl: '' },
  { property: 'constructionSupervision', label: '施工监理', width: 200, show: true, type: 'select', dataResource: 1, enumName:'Checked', remoteUrl: '/citymh/enum/getData4AddBy' },
  { property: 'constructionSupervisionTime', label: '施工监理时间', width: 200, show: true, type: 'date-range', dataResource: 0, enumName:'ConstructionSupervisionTime', remoteUrl: '' },
  { property: 'projectMainUnit', label: '发起方单位', width: 200, show: true, type: 'input', dataResource: 0, enumName:'ProjectMainUnit', remoteUrl: '' },
  { property: 'phone', label: '电话', width: 200, show: true, type: 'input', dataResource: 0, enumName:'Phone', remoteUrl: '' },*/
 /* { property: 'deleteflag', label: '删除标志', width: 200, show: true, type: 'select', dataResource: 1, enumName:'Deleteflag', remoteUrl: '/citymh/enum/getData4AddBy' },
 */ { property: 'createdate', label: '创建日期', width: 200, show: true, type: 'date-range', dataResource: 0, enumName:'Createdate', remoteUrl: '' }
]
// 所有列对象
export const theadOptions = [
      /*{ property: 'id', label: 'ID', width: storageUtil.getColumnWidthFromStorage('id', 150, ColumnShowListWidthKey), show: true, edit: false, sort: 'custom', fixed: false} ,
    */
      { property: 'projectName', label: '项目名称', width: storageUtil.getColumnWidthFromStorage('projectName', 150, ColumnShowListWidthKey), show: true, edit: true, sort: false, fixed: false} ,
      { property: 'projectAddr', label: '项目地址', width: storageUtil.getColumnWidthFromStorage('projectAddr', 150, ColumnShowListWidthKey), show: true, edit: true, sort: false, fixed: false} ,
     /* { property: 'projectMainUnitLinkman', label: '项目负责人', width: storageUtil.getColumnWidthFromStorage('projectMainUnitLinkman', 150, ColumnShowListWidthKey), show: true, edit: true, sort: false, fixed: false} ,
*/  /* { property: 'unitBidderId', label: '定点供应商id', width: storageUtil.getColumnWidthFromStorage('unitBidderId', 150, ColumnShowListWidthKey), show: true, edit: true, sort: false, fixed: false} ,
*/  // 枚举对象， json结构，如: {'id':1, 'name':'无效'}
  /*{ property: 'status.name', label: '项目状态', width: storageUtil.getColumnWidthFromStorage('status.name', 150, ColumnShowListWidthKey), show: true, edit: true, sort: false, fixed: false, dataResource: 1, columnType: 'select', enumName:'Status', remoteUrl: '/citymh/enum/getData4AddBy'} ,

  { property: 'projectBasis', label: '项目依据', width: storageUtil.getColumnWidthFromStorage('projectBasis', 150, ColumnShowListWidthKey), show: true, edit: true, sort: false, fixed: false} ,
      { property: 'telephone', label: '联系电话', width: storageUtil.getColumnWidthFromStorage('telephone', 150, ColumnShowListWidthKey), show: true, edit: true, sort: false, fixed: false} ,
*/     /* { property: 'fundSourceCityFinacial', label: '市财力', width: storageUtil.getColumnWidthFromStorage('fundSourceCityFinacial', 150, ColumnShowListWidthKey), show: true, edit: true, sort: false, fixed: false} ,
   */   /*{ property: 'fundSourceDistrictFinancing', label: '区融资', width: storageUtil.getColumnWidthFromStorage('fundSourceDistrictFinancing', 150, ColumnShowListWidthKey), show: true, edit: true, sort: false, fixed: false} ,
      *//*{ property: 'fundSourceDistrictFinance', label: '区财政', width: storageUtil.getColumnWidthFromStorage('fundSourceDistrictFinance', 150, ColumnShowListWidthKey), show: true, edit: true, sort: false, fixed: false} ,
      { property: 'fundSourceOthers', label: '其他', width: storageUtil.getColumnWidthFromStorage('fundSourceOthers', 150, ColumnShowListWidthKey), show: true, edit: true, sort: false, fixed: false} ,
   */   // 枚举对象， json结构，如: {'id':1, 'name':'无效'}
      /*{ property: 'categoryProject.name', label: '项目类型', width: storageUtil.getColumnWidthFromStorage('categoryProject.name', 150, ColumnShowListWidthKey), show: true, edit: true, sort: false, fixed: false, dataResource: 1, columnType: 'select', enumName:'CategoryProject', remoteUrl: '/citymh/enum/getData4AddBy'} ,
     */ { property: 'totalInvestment', label: '建安投资', width: storageUtil.getColumnWidthFromStorage('totalInvestment', 150, ColumnShowListWidthKey), show: true, edit: true, sort: false, fixed: false} ,
     /* { property: 'startTimePlan', label: '项目预计开工时间', width: storageUtil.getColumnWidthFromStorage('startTimePlan', 150, ColumnShowListWidthKey), show: true, edit: true, sort: false, fixed: false} ,
      { property: 'endTimePlan', label: '项目预计完工时间', width: storageUtil.getColumnWidthFromStorage('endTimePlan', 150, ColumnShowListWidthKey), show: true, edit: true, sort: false, fixed: false} ,
      { property: 'startTimeActual', label: '项目实际开工时间', width: storageUtil.getColumnWidthFromStorage('startTimeActual', 150, ColumnShowListWidthKey), show: true, edit: true, sort: false, fixed: false} ,
      { property: 'endTimeActual', label: '项目实际完工时间', width: storageUtil.getColumnWidthFromStorage('endTimeActual', 150, ColumnShowListWidthKey), show: true, edit: true, sort: false, fixed: false} ,
      // 枚举对象， json结构，如: {'id':1, 'name':'无效'}
      { property: 'investmentSupervision.name', label: '投资监理', width: storageUtil.getColumnWidthFromStorage('investmentSupervision.name', 150, ColumnShowListWidthKey), show: true, edit: true, sort: false, fixed: false, dataResource: 1, columnType: 'select', enumName:'Checked', remoteUrl: '/citymh/enum/getData4AddBy'} ,
      { property: 'investmentSupervisionTime', label: '投资监理时间', width: storageUtil.getColumnWidthFromStorage('investmentSupervisionTime', 150, ColumnShowListWidthKey), show: true, edit: true, sort: false, fixed: false} ,
      // 枚举对象， json结构，如: {'id':1, 'name':'无效'}
      { property: 'constructionSupervision.name', label: '施工监理', width: storageUtil.getColumnWidthFromStorage('constructionSupervision.name', 150, ColumnShowListWidthKey), show: true, edit: true, sort: false, fixed: false, dataResource: 1, columnType: 'select', enumName:'Checked', remoteUrl: '/citymh/enum/getData4AddBy'} ,
      { property: 'constructionSupervisionTime', label: '施工监理时间', width: storageUtil.getColumnWidthFromStorage('constructionSupervisionTime', 150, ColumnShowListWidthKey), show: true, edit: true, sort: false, fixed: false} ,
      { property: 'projectMainUnit', label: '发起方单位', width: storageUtil.getColumnWidthFromStorage('projectMainUnit', 150, ColumnShowListWidthKey), show: true, edit: true, sort: false, fixed: false} ,
      { property: 'phone', label: '电话', width: storageUtil.getColumnWidthFromStorage('phone', 150, ColumnShowListWidthKey), show: true, edit: true, sort: false, fixed: false} ,
     */ // 枚举对象， json结构，如: {'id':1, 'name':'无效'}
     /* { property: 'deleteflag.name', label: '删除标志', width: storageUtil.getColumnWidthFromStorage('deleteflag.name', 150, ColumnShowListWidthKey), show: true, edit: true, sort: false, fixed: false, dataResource: 1, columnType: 'select', enumName:'Deleteflag', remoteUrl: '/citymh/enum/getData4AddBy'} ,
      { property: 'modifydate', label: '修改日期', width: storageUtil.getColumnWidthFromStorage('modifydate', 150, ColumnShowListWidthKey), show: true, edit: false, sort: false, fixed: false} ,
      { property: 'createman', label: '创建人', width: storageUtil.getColumnWidthFromStorage('createman', 150, ColumnShowListWidthKey), show: true, edit: false, sort: false, fixed: false} ,
      { property: 'modifyman', label: '修改人', width: storageUtil.getColumnWidthFromStorage('modifyman', 150, ColumnShowListWidthKey), show: true, edit: false, sort: false, fixed: false} ,
*/      { property: 'createdate', label: '创建日期', width: storageUtil.getColumnWidthFromStorage('createdate', 150, ColumnShowListWidthKey), show: true, edit: false, sort: false, fixed: false}
]

export const pickerOptions = {
  shortcuts: [{
    text: '最近一周',
    onClick(picker) {
      const end = new Date()
      const start = new Date()
      start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
      picker.$emit('pick', [start, end])
    }
  }, {
    text: '最近一个月',
    onClick(picker) {
      const end = new Date()
      const start = new Date()
      start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
      picker.$emit('pick', [start, end])
    }
  }, {
    text: '最近三个月',
    onClick(picker) {
      const end = new Date()
      const start = new Date()
      start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
      picker.$emit('pick', [start, end])
    }
  }]
}

export const pickerOptionsSingleDate = {
  disabledDate(time) {
    return time.getTime() > Date.now()
  },
  shortcuts: [{
    text: '今天',
    onClick(picker) {
      picker.$emit('pick', new Date())
    }
  }, {
    text: '昨天',
    onClick(picker) {
      const date = new Date()
      date.setTime(date.getTime() - 3600 * 1000 * 24)
      picker.$emit('pick', date)
    }
  }, {
    text: '一周前',
    onClick(picker) {
      const date = new Date()
      date.setTime(date.getTime() - 3600 * 1000 * 24 * 7)
      picker.$emit('pick', date)
    }
  }]
}
